package vsjgl;

import org.lwjgl.opengl.GL11;

public class Square {
	private int height,width,x,y;
	private float r,g,b;
	public Square(int width,int height,int x,int y){
		
		this.width= width;
		this.height= height;
		
		this.x= x;
		this.y= y;
		
		this.r=1.0f; //Default color : White
		this.g=1.0f;
		this.b=1.0f;
	}
	public void setColor(float i,float j,float k){
		this.r= i/255;
		this.g= j/255;
		this.b= k/255;
	}
	public int GetX(){
		return x;
	}
	public int GetY(){
		return y;
	}
	public void setX(int newx){
		x = newx;
	}
	public void setY(int newy){
		y = newy;
	}
	public void draw(){
		GL11.glColor3f(r,g,b);

		GL11.glBegin(GL11.GL_QUADS);
	    GL11.glVertex2f(x,y);
		GL11.glVertex2f(x+width,y);
		GL11.glVertex2f(x+width,y+height);
		GL11.glVertex2f(x,y+height);
	    GL11.glEnd();
	}
}
